package com.ktgj.customer.mapper;

import java.util.List;

import com.ktgj.common.core.constant.FlightOrderConstants;
import com.ktgj.customer.domain.CustomerCard;
import com.ktgj.customer.domain.CustomerRightdetail;
import com.ktgj.customer.domain.dto.CustomerCRMDataCardDataDTO;
import com.ktgj.customer.domain.dto.CustomerCardDTO;
import com.ktgj.customer.domain.vo.CardSaleRecords;
import org.apache.ibatis.annotations.Param;

/**
 * 会员卡Mapper接口
 * 
 * @author ruoyi
 * @date 2021-07-30
 */
public interface CustomerCardMapper 
{
    /**
     * 查询会员卡
     * 
     * @param customerCardId 会员卡ID
     * @return 会员卡
     */
    public CustomerCard selectCustomerCardById(Long customerCardId);

    public CustomerCard selectCustomerCard(String cardCode);

    public String selectLastCustomerCardCodeByCardId(Long customerCardId);

    /**
     * 查询会员卡列表
     * 
     * @param customerCard 会员卡
     * @return 会员卡集合
     */
    public List<CustomerCard> selectCustomerCardList(CustomerCard customerCard);

    /**
     * 新增会员卡
     * 
     * @param customerCard 会员卡
     * @return 结果
     */
    public int insertCustomerCard(CustomerCard customerCard);

    /**
     * 修改会员卡
     * 
     * @param customerCard 会员卡
     * @return 结果
     */
    public int updateCustomerCard(CustomerCard customerCard);

    /**
     * 删除会员卡
     * 
     * @param customerCardId 会员卡ID
     * @return 结果
     */
    public int deleteCustomerCardById(Long customerCardId);

    /**
     * 批量删除会员卡
     * 
     * @param customerCardIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteCustomerCardByIds(Long[] customerCardIds);

    public Long selectCardIdById(Long id);

    /**
     * 我的-会员状态(显示)
     * 根据客户基本信息Id查询
     * @param customerId
     * @return
     */
    public List<CustomerCardDTO> selectCustomerCardByCustomerId(Long customerId);

    /**
     * 我的-会员状态(更新)
     * 根据客户基本信息Id查询
     * @param customerCard
     * @return
     */
    public int updateCustomerCardByCustomerId(CustomerCard customerCard);

    /**
     * 查询vip通道订单(远程)
     * */
    public CustomerCard selectVipOrder(Long customerId);

    /**
     * 查询卡号（远程）
     * @param customerId
     * @return
     */
    public List<CustomerCard> queryCardIdByCustomerId(Long customerId);

    /**
     * 查询当前会员的会员卡id
     * */
    public List<CustomerCard> CustomerCardList(Long customerId);

    /**
     * 查询卡号
     * */
//    public CustomerCard backSelectCustomerCard(@Param("cardId") Long cardId, @Param("customerId") Long customerId);
    public CustomerCard backSelectCustomerCard(Long cardId);

    /**
     * 查询卡id
     * */
    public CustomerCard backSelectCustomerCardByCardCode(String cardCode);

    /**
     * 售卡量统计
     * */
    public List<CustomerCard> statisticsCardSales(@Param("pagesNum") int pagesNum, @Param("barsNum") int barsNum);

    /**
     * 退卡列表
     * */
    public List<CustomerCard> checkOutList(@Param("cardCode") String cardCode);

    /**
     * 续费列表
     * */
    public List<CustomerCard> renewalList(@Param("cardCode") String cardCode);

    /**
     * 续费新卡信息
     * */
    public CustomerCard newRenewal(Long xfId);

    /**
     * 退续费列表
     * */
    public List<CustomerCard> checkOutRenewalList(@Param("cardCode") String cardCode);

    /**
     * 会员卡信息查询id
     * */
    public CustomerCard customerId(String cardCode);

    /**
     * id查卡号
     * */
    public CustomerCard customerCardNum(Long customerCardId);

    /**
     * 查询数据每个部门的售卡条数
     * @param cardSaleRecords
     * @return
     */
    public List<CardSaleRecords> selectCardSaleNum(CardSaleRecords cardSaleRecords);

    /**
     * 查询单个部门的售卡记录
     * @param cardSaleRecords
     * @return
     */
    public List<CardSaleRecords> selectCardSaleRecords(CardSaleRecords cardSaleRecords);

    public List<CustomerCRMDataCardDataDTO> queryCustomerCRMDataCardDataDTO(@Param("customerId") Long customerId);

    List<CustomerCard> selectCustomerCardByInvalid();

    void updateCardInvalid();

    public List<CustomerCard> cardInvalid(Long cardCode);

    public List<CustomerCard> customerCards(@Param("customerId") Long customerId, @Param("cardId") Long cardId);
}
